package com.example.graduatedesigned.bean;

import com.chad.library.adapter.base.entity.MultiItemEntity;

public class ItemBean implements MultiItemEntity {
    private String title;
    private String text;
    private int icon;
    private String type;
    private boolean isChecked;

    public ItemBean(String title, String text, int icon, String type, boolean isChecked) {
        this.title = title;
        this.text = text;
        this.icon = icon;
        this.type = type;
        this.isChecked = isChecked;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getIcon() {
        return icon;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static final int TYPE_NORMAL = 0;
    public static final int TYPE_SWITCH = 1;

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    @Override
    public int getItemType() {
        if (type.equals("0")) {
            return TYPE_NORMAL;
        } else {
            return TYPE_SWITCH;
        }
    }
}
